﻿using System;
using System.Data;


public  class TransactionsBAL

    {
       private TransactionsDAL _TransactionsDal;

       public TransactionsBAL() : this(new TransactionsDAL()) { }
       public TransactionsBAL(TransactionsDAL TransactionsDAL) { _TransactionsDal = TransactionsDAL; }

     

       public int InsertTransaction(TransactionsBO Transactions)
       {
           //TransactionsDAL Insert = new TransactionsDAL();
           try
           {

               return _TransactionsDal.AddTransaction(Transactions);



           }
           catch (Exception ex)
           {
               throw ex;


           }
           finally
           {

               _TransactionsDal = null;

           }
       }

       //public int UpdatePayerAccount(TransactionsBO Transactions)
       //{
       //    TransactionsDAL UpDatePayer = new TransactionsDAL();


       //    try
       //    {

       //        return UpDatePayer.PayerUpdateAccount(Transactions);



       //    }
       //    catch (Exception ex)
       //    {
       //        throw ex;


       //    }
       //    finally
       //    {

       //        UpDatePayer = null;

       //    }
       //}

       //public int UpdatePayeeAccount(TransactionsBO Transactions)
       //{
       //    TransactionsDAL PayeeAcc = new TransactionsDAL();

       //    try
       //    {

       //        return PayeeAcc.PayeeUpdateAccount(Transactions);



       //    }
       //    catch (Exception ex)
       //    {
       //        throw ex;


       //    }
       //    finally
       //    {

       //        PayeeAcc = null;

       //    }
       //}

       public DataTable AccountFillDropDown()
       {


           try
           {

               return _TransactionsDal.AccountFillDropDown();

           }

           catch
           {

               throw;

           }

           finally
           {

               _TransactionsDal = null;

           }

       }
       public decimal GetPayeeAmount(TransactionsBO Transactions)
       {

           try
           {

               return _TransactionsDal.GetPayeeAmount(Transactions);



           }
           catch (Exception ex)
           {
               throw ex;


           }
           finally
           {

              // _TransactionsDal = null;

           }
       }

       public decimal GetPayerAmount(TransactionsBO Transactions)
       {
          // TransactionsDAL v = new TransactionsDAL();

           try
           {

               return _TransactionsDal.GetPayerAmount(Transactions);



           }
           catch (Exception ex)
           {
               throw ex;


           }
           finally
           {

               //v = null;

           }
       }

    }

